classdef spyfilt_lbl < spyview_filter
    properties (Constant=true)
        name='Sub LBL';
        description='Subtract a median/mean from each line';
        parameters=struct('name',{'Median','Vertical'},'type',{'bool','bool'},'default',{0,0});
    end
    methods
        function [pm,px,py]=filter(sf,pm,px,py)
            if sf.values{1}
                func=@median;
            else
                func=@mean;
            end
            if ~sf.values{2}
                pm=pm-repmat(func(pm,2),1,size(pm,2));
            else
                pm=pm-repmat(func(pm,1),size(pm,1),1);
            end
        end
    end
end